package com.wz.project.api.barcode.controller;

import com.wz.framework.web.page.TableDataInfo;
import com.wz.project.api.barcode.domain.BarcodeFwm;
import com.wz.project.api.barcode.domain.BarcodeInfo;
import com.wz.project.api.barcode.domain.MatnrInfo;
import com.wz.project.api.barcode.service.BarcodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@CrossOrigin
@RequestMapping("/barcode")

public class BarcodeController {
    @Autowired
    BarcodeService barcodeService;

    @RequestMapping("/barcode_info")
    @ResponseBody
    public BarcodeInfo getBarcodeInfo(String barcodeInfo) {
        BarcodeInfo barcodeInfo1 = barcodeService.selectBarcodeById(barcodeInfo);
        return barcodeInfo1;
    }


    @RequestMapping("/matnr_info")
    @ResponseBody
    public List<MatnrInfo> getMatnrInfo(MatnrInfo matnrInfo) {
        List<MatnrInfo> matnrInfoList = barcodeService.selectMatnrInfo(matnrInfo);
        return matnrInfoList;
    }

    @RequestMapping("/barcode_fwm")
    @ResponseBody
    public List<BarcodeFwm> getBarcodeFwmInfo(BarcodeFwm barcodeFwm) {
        List<BarcodeFwm> barcodeFwmList = barcodeService.selectBarcodeFwmInfo(barcodeFwm);
        return barcodeFwmList;
    }

}
